package com.jxust.hr.controller;

import com.jxust.debate.feign.AdminService;
import com.jxust.hr.service.TestService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author tyeerth
 * @date 2020/12/27 - 14:47
 */
@RestController
@RequestMapping("/hr")

@Api("测试")
public class TestController {
    @Resource
    private TestService testService;

    @Resource
    private AdminService adminService;

    //    @RequestMapping("/testService")
//    public List<DemoEntity> testService(){
//        return testService.getAll();
//    }
    @RequestMapping("/hello")
    public String hrhelo() {
        return "hr ,hello";
    }

    @RequestMapping("/testAdmin")
    public String testAdmin() {
        return adminService.hello();
    }


    @ApiOperation(value = "计算+", notes = "加法")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "a", paramType = "path", value = "数字a", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "b", paramType = "path", value = "数字b", required = true, dataType = "Long")
    })

    @GetMapping("/{a}/{b}")
    public Integer get(@PathVariable int a, @PathVariable int b) {
        return a + b;
    }
}
